import request from '@/axios/axios.js'

// 列表
export const searchApi = (params) => {
    return request({
        method: 'post',
        url: '/dms/productionOrder/page',
        data: params
    })
}
//根据模具编号查询设备信息
export const getDeviceList = (params) => {
    return request({
        method: 'get',
        url: '/dms/productionWork/selectDeviceByMoldCode',
        params: params
    })
}
//根据物料编码查询模具信息
export const getMoldList = (params) => {
    return request({
        method: 'get',
        url: '/dms/productionWork/selectMoldByMaterialCode',
        params: {...params, ...{status: 1}}
    })
}
export const add = (params, status) => {
    return request({
        method: status == 'add' ? 'post' : 'put',
        url: status == 'add' ? '/dms/productionWork/handProduce' : '/dms/productionWork/updateWorkOrder',
        data: params
    })
}
export const deleteApi = (params) => {
    return request({
        method: 'delete',
        url: '/dms/productionWork/deleteWorkOrder',
        data: params
    })
}
//获得工单的预计时间
export const assistedScheduling = (params) => {
    return request({
        method: 'POST',
        url: '/dms/productionWork/assistedScheduling',
        params: params
    })
}


